<template>
	<div class="login">
		<TopBar titles="登录"></TopBar>
		
		<!-- 登录框 -->
		<div class="login-wrapper">
			<van-cell-group class="input-group">
			  <van-field v-model="user.phone" label="用户名" placeholder="请输入用户名" />
			  <van-field v-model="user.pwd" label="密码" type="password" placeholder="请输入密码" />
			</van-cell-group>
			<van-button type="primary" round block @click="login">登录</van-button>
		</div>
	</div>
</template>

<script>
	// 引用的组件
	import allComponent from '../util/allComponent.js'
	// 控制器
	import {loginController} from '../controller/loginController.js'
	
	export default {
		name:'Login',
		data:function(){
			return {
				user:{
					phone:'',
					pwd:''
				}
			}
		},
		components:{
			TopBar : allComponent.TopBar,
			BottomBar : allComponent.BottomBar,
		},
		methods:{
			login(){
				loginController.login(this);
			}
		}
	}
</script>

<style scoped="scoped">
	.input-group {
		margin-bottom: 1.25rem;
	}
</style>
